<ul class="nav nav-tabs">
    <% 
		// PC端直接渲染前五个菜单，移动端渲染前三个菜单
		var showCount = data.isMobile?3:5;
        var menu = data.menu;
		for(var i=menu.length-1;i>=0;i--){
			if (data.isMobile){
				if (!menu[i].mobile){
					menu.splice(i, 1);
				}
			}else{
				if (!menu[i].pc){
					menu.splice(i, 1);
				}
			}
		}
        var count = menu.length<showCount?menu.length:showCount;
        for(var i=0;i<count;i++){
    %>
    <li <% if(menu[i].checked){p('class="active"');} %>>
        <a href="<%if(menu[i].href){p(menu[i].template);}else{p('javascript:;');}%>" 
            <%if(menu[i].href){p('target="_blank"');}%>
            <%if(!menu[i].checked && !menu[i].href){%>
            onclick="route.go('<% p(menu[i].template) %>');"
            <%}%>
        ><%p(menu[i].title)%></a>
    </li>
    <%  }  %>
    <!-- 如果菜单项大于直接渲染数量，则放到右边渲染 -->
    <%  if(menu.length > showCount){ %>
        <li class="dropdown pull-right">
            <a href="#" data-toggle="dropdown" class="dropdown-toggle">更多<strong class="caret"></strong></a>
            <ul class="dropdown-menu">
            <% for(var i=showCount;i<menu.length;i++){ %>
                <li>
                    <a href="<%if(menu[i].href){p(menu[i].template);}else{p('javascript:;');}%>" 
                        <%if(menu[i].href){p('target="_blank"');}%>
                        <% if(!menu[i].checked && !menu[i].href) { %>
                        onclick="route.go('<% p(menu[i].template) %>');"
                        <% } %>
                    ><% p(menu[i].title) %></a>
                </li>    
            <% } %>
            </ul>
        </li>
    <%  }  %>
</ul>
<!-- 通用modal模块 -->
<% $.et.load('template/modal.et.html', data) %>